.app-navigator {
  position: absolute;
  inset: auto 0 0 0;
  font-size: 12px;
  color: plv(text-3);
  user-select: none;
  overflow: visible;
  height: var(--app-navigator);
  opacity: 1;
  transition: opacity 300ms ease;

  &.app-navigator-not-ready {
    opacity: 0;
  }

  .app-navigator-list {
    display: flex;
    align-items: center;
  }

  .app-navigator-item-wrapper {
    padding: 0 plv(box-size-normal-border-radius);
    box-sizing: border-box;
  }

  .app-navigator-item {
    display: flex;
    align-items: center;
    padding: 0 0;
    border-top-left-radius: plv(box-size-normal-border-radius);
    border-top-right-radius: plv(box-size-normal-border-radius);
    height: var(--app-navigator);
    line-height: var(--app-navigator);
    cursor: pointer;
    //transition: all ease 300ms;
    box-sizing: border-box;
    position: relative;
    flex-wrap: nowrap;
    white-space: nowrap;
    background-color: plv(bg-2);

    &:after {
      position: absolute;
      right: calc(#{plv(box-size-normal-border-radius)} / 2 * -1);
      top: 7px;
      bottom: 7px;
      width: 1px;
      background-color: plv(border-color);
      content: '';
      z-index: 4;
    }

    .app-navigator-item-inner {
      position: relative;
      display: flex;
      align-items: center;

      &:before, &:after {
        content: '';
        height: 1em;
        transition: all ease 300ms;
      }
    }

    @include comp(icon) {
      & + span {
        margin-left: 4px;
      }
    }

    &:hover {
      //color: plv(primary-6);
      //border-color: plv(primary-6);
    }

    .app-navigator-item-close {
      overflow: hidden;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      height: 16px;
      transition: all ease 300ms;

      @include comp(icon) {
        position: relative;
        left: 2px;
        transform: scale(0.9);
      }

      &:hover {
        background-color: plv(secondary-3);
      }
    }

    &[data-active=true] {
      background-color: plv(bg-1);
      color: plv(primary-6);
      font-weight: 600;

      .app-navigator-item-close {
        //background-color: plv(secondary-3);
      }

      .app-navigator-item-prepend {
        right: 100%;
      }

      .app-navigator-item-append {
        left: 100%;
      }

      .app-navigator-item-prepend, .app-navigator-item-append {
        position: absolute;
        bottom: 0;
        height: plv(box-size-normal-border-radius);
        width: plv(box-size-normal-border-radius);
        transition: none;

        path {
          fill: plv(bg-1);
        }
      }

    }

    &:not(:hover) {
      .app-navigator-item-inner {
        &:before, &:after {
          width: 16px;
        }
      }

      .app-navigator-item-close {
        width: 0;
        margin-left: 0;
      }
    }

    &:hover {
      .app-navigator-item-inner {
        &:before, &:after {
          width: 7px;
        }
      }

      .app-navigator-item-close {
        width: 16px;
        margin-left: 2px;
      }
    }

    &:last-child, &[data-active=true], &.app-navigator-item-prev-active, &.app-navigator-item-next-active {
      &:after {
        content: none;
      }
    }
  }

  @include comp(scroll) {
    .scroll-content {
      overflow-x: hidden;
    }
    .horizontal-scrollbar-wrapper {
      display: none;
    }
  }

  $scroll_btn_size: 16px;
  $scroll_btn_space: 2px;

  &.app-navigator-scroll {
    left: calc(#{$scroll_btn_size} + #{$scroll_btn_space} * 2);
    right: calc(#{$scroll_btn_size} + #{$scroll_btn_space} * 2);

    & > .#{componentName(scroll)} {
      &:before {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        content: '';
        box-shadow: 0 2px 5px plv(text-2);
        z-index: 5;
        width: 1px;
      }

      &:after {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        content: '';
        box-shadow: 0 2px 5px plv(text-2);
        z-index: 5;
        width: 1px;
      }
    }

    .app-navigator-prev-button, .app-navigator-next-button {
      position: absolute;
      width: $scroll_btn_size;
      top: 2px;
      bottom: 2px;
      //color: plv(text-3);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      border-radius: plv(box-size-mini-border-radius);
      background-color: plv(secondary-2);
      color: plv(text-2);

      &:hover {
        background-color: plv(primary-light-2);
        color: plv(primary-6);
      }
    }

    .app-navigator-prev-button {
      right: calc(100% + #{$scroll_btn_space});
    }

    .app-navigator-next-button {
      left: calc(100% + #{$scroll_btn_space});
    }
  }

  &:not(.app-navigator-scroll) {
    .app-navigator-item-wrapper {
      &:first-child, &[data-shadow-item="0"] {
        padding-left: 0;
      }
    }
  }
}

.app-container {
  @include sizeMixin(app-container, ()) {
    .app-navigator {

      .app-navigator-list {
        .app-navigator-item {

        }
      }
    }
  }

  &.app-container-dark {
    .app-navigator {
      .app-navigator-item {
        &[data-active=true] {
          background-color: plv(secondary-2);
        }

        .app-navigator-item-prepend, .app-navigator-item-append {
          path {
            fill: plv(secondary-2);
          }
        }
      }
    }
  }
}
